package com.fms.controller;

import com.fms.result.ResultData;
import com.fms.entity.Client;
import com.fms.service.ClientService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/client")
@RequiredArgsConstructor
public class ClientController {

    private final ClientService clientService;
    @GetMapping("/clientList")
    public ResultData getClientList(){
        List<Client> clients = clientService.getClientList();
        return ResultData.success(clients);
    }
}
